#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    long long countCompleteDayPairs(vector<int>& hours) {
        int cnt[24]{};
        long long ans = 0;
        for (auto h : hours)
        {
            ans += cnt[(24 - h % 24) % 24];
            ++cnt[h % 24];
        }
        return ans;
    }
};